<?php
use yesf\Yesf;
use yesf\library\Plugin;
use ag\library\Common;
use ag\library\Event;
use ag\model\Config;

class Bootstrap {
	public function run() {
		date_default_timezone_set('Asia/Shanghai');
		//注册自动加载
		Yesf::getLoader()->addPsr4('ag\\library\\', APP_PATH . 'library');
		Yesf::getLoader()->addPsr4('ag\\service\\', SERVICE_PATH);
		//注册事件
		Plugin::register('workerStart', ['ag\\library\\Event', 'onWorkerStart']);
		Plugin::register('beforeDispatcher', ['ag\\library\\Event', 'onDispatcher']);
		Event::registerTcpListen();
		//初始化
		Config::getInstance();
	}
}